home *** CD-ROM | disk | FTP | other *** search
/ Avalanche Ranch: Clip Ar… Song Lyrics & Decorating / Avalanche Ranch: Clip Art, Song Lyrics & Decorating - Disc 2.iso / mac / media / menu_4.swf / scripts / frame_1 / PlaceObject2_23_9 / CLIPACTIONRECORD onClipEvent(load).as
Text File  |  2006-11-03  |  2KB  |  73 lines

  1. onClipEvent(load){
  2.    function buildMenu(pMenuNum)
  3.    {
  4.       btns._y = 0;
  5.       this.selectedParent = pMenuNum;
  6.       if(ani_open._currentframe == 1)
  7.       {
  8.          ani_open.gotoAndPlay(2);
  9.          if(this.previouslyLoaded > -1)
  10.          {
  11.             f = 1;
  12.             while(f <= this.previouslyLoaded)
  13.             {
  14.                eval("btns.btn" + f).removeMovieClip();
  15.                f++;
  16.             }
  17.          }
  18.          i = 0;
  19.          while(i < _global.menuArray[pMenuNum].items.length)
  20.          {
  21.             btns.attachMovie("menu1_item","btn" + i,i + 1);
  22.             btnInst = eval("btns.btn" + i);
  23.             btnInst._x = 0;
  24.             btnInst._y = 17 * i;
  25.             btnInst.thisIndex = i;
  26.             btnInst.txt.val = _global.menuArray[pMenuNum].items[i].title;
  27.             this.previouslyLoaded = i;
  28.             i++;
  29.          }
  30.       }
  31.       this.collapse();
  32.       return 0;
  33.    }
  34.    function resetAllBtns(skipIndex)
  35.    {
  36.       i = 0;
  37.       while(i < 100)
  38.       {
  39.          if(i != skipIndex)
  40.          {
  41.             btnInst = eval("btns.btn" + i);
  42.             btnInst.isSelected = 0;
  43.          }
  44.          i++;
  45.       }
  46.    }
  47.    function buttonClicked(btnIndex)
  48.    {
  49.       this.theSelected = btnIndex;
  50.       _root.menu3.buildMenu(btnIndex);
  51.       getUrl("closeData", "");
  52.    }
  53.    function collapse()
  54.    {
  55.       if(ani_open._currentframe != 1)
  56.       {
  57.          ani_open.gotoAndPlay("close");
  58.       }
  59.       if(this.previouslyLoaded > -1)
  60.       {
  61.          f = 0;
  62.          while(f <= this.previouslyLoaded)
  63.          {
  64.             eval("btns.btn" + f).removeMovieClip();
  65.             f++;
  66.          }
  67.       }
  68.    }
  69.    this.menuNum = 2;
  70.    this.theSelected = null;
  71.    this.selectedParent = null;
  72. }
  73.